----------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\Public\Documents\Old\Lavoro Gregory\Heckman.log
  log type:  text
 opened on:   3 Sep 2013, 15:00:14

. 
. 
. use "Calcoli\Final_database_extensive_JIE.dta", clear

. 
. sort siren

. 
. merge siren using Calcoli\Selection_firm_JIE.dta
(note: you are using old merge syntax; see [D] merge for new syntax)
variable siren does not uniquely identify observations in the master data

. drop _merge

. rename IM_firm IM_being_EIIG

. replace  IM=0 if  IM==.
(962463 real changes made)

. keep if EIIG==1 | champ_theorique==0 
(104145 observations deleted)

. sort siren

. merge siren using "Calcoli\random_no_EIIG_champs_theorique_JIE.dta"
(note: you are using old merge syntax; see [D] merge for new syntax)
variable siren does not uniquely identify observations in the master data

. keep if EIIG==1 | champ_theorique==0 &  random_no_EIIG_champs_theorique==1
(755829 observations deleted)

. drop _merge

. drop if  ln_lp_tfprod==.
(183251 observations deleted)

. 
. 
. gen contr_orig1=(1-frac_lib_diff_orig)
(2095 missing values generated)

. gen contr_orig2=(1-frac_lib_not_homog_orig)
(2095 missing values generated)

. 
. gen contr_prod1=(1-frac_lib_diff_prod_4dig)
(4845 missing values generated)

. gen contr_prod2=(1-frac_lib_not_homog_prod_4dig)
(4845 missing values generated)

. 
. gen ln_distw=log(distw)
(329 missing values generated)

. gen ln_pop=log(pop)
(490 missing values generated)

. gen ln_gdp=log(gdp)
(519 missing values generated)

. drop if  ln_lp_tfprod==.
(0 observations deleted)

. egen ln_lp_tfprod_aver=mean(ln_lp_tfprod), by (nace_rev1_3dig)

. gen  ln_lp_tfprod2=ln_lp_tfprod- ln_lp_tfprod_aver

. drop ln_lp_tfprod_aver

. 
. 
. 
. 
. destring  siren, generate(siren_number)
siren has all characters numeric; siren_number generated as long

. 
. iis siren_number

. 
. sort siren

. 
. merge siren using "Calcoli\Multinationals.dta"
(note: you are using old merge syntax; see [D] merge for new syntax)
variable siren does not uniquely identify observations in the master data

. drop if _merge==2
(5857 observations deleted)

. drop _merge

. replace  multinational=0 if  multinational==.
(77098 real changes made)

. 
. gen ln_val=log(val)
(238 missing values generated)

. 
. local instruct "tex tdec(4) rdec(4) auto(4) bdec(4) sdec(4) symbol($^a$,$^b$,$^c$)  se"

. 
. 
. probit intra_firm  multinational ln_lp_tfprod2   ln_capital_intensity_firm  ln_wage_based_skills_firm    ln_kl ln_hl
>    contr_orig1 contr_prod1 Qc  ln_capital_intensity_cpa_4 ln_skill_intensity_cpa_4  corp_tax_r financ_develop  oecd_
> 1999   ln_distw  French_colony French_speaking legor_fr IM_being_EIIG  , cluster(siren)

Iteration 0:   log pseudolikelihood = -34364.214  
Iteration 1:   log pseudolikelihood = -29905.566  
Iteration 2:   log pseudolikelihood = -29765.814  
Iteration 3:   log pseudolikelihood = -29765.455  
Iteration 4:   log pseudolikelihood = -29765.455  

Probit regression                                 Number of obs   =      82923
                                                  Wald chi2(19)   =     547.46
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -29765.455                 Pseudo R2       =     0.1338

                                             (Std. Err. adjusted for 4737 clusters in siren)
--------------------------------------------------------------------------------------------
                           |               Robust
                intra_firm |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
---------------------------+----------------------------------------------------------------
             multinational |   .5163951   .0647957     7.97   0.000     .3893979    .6433923
             ln_lp_tfprod2 |   .1721622   .0662996     2.60   0.009     .0422173     .302107
 ln_capital_intensity_firm |    .075864   .0329308     2.30   0.021     .0113209    .1404071
 ln_wage_based_skills_firm |   .4305779    .168588     2.55   0.011     .1001516    .7610042
                     ln_kl |  -.0995709   .0275961    -3.61   0.000    -.1536582   -.0454835
                     ln_hl |   .2905397   .0968288     3.00   0.003     .1007587    .4803207
               contr_orig1 |   -.212431   .0337752    -6.29   0.000    -.2786291   -.1462329
               contr_prod1 |   -.337937   .0709116    -4.77   0.000    -.4769212   -.1989528
                        Qc |   .6634176   .1966348     3.37   0.001     .2780205    1.048815
ln_capital_intensity_cpa_4 |   .0145545   .0264128     0.55   0.582    -.0372137    .0663227
  ln_skill_intensity_cpa_4 |   .3002378   .0875127     3.43   0.001     .1287162    .4717595
                corp_tax_r |  -.6474457   .3121754    -2.07   0.038    -1.259298   -.0355931
            financ_develop |  -.0985292   .0483776    -2.04   0.042    -.1933476   -.0037108
                 oecd_1999 |   .0816021   .0536217     1.52   0.128    -.0234945    .1866987
                  ln_distw |   .1091758   .0253071     4.31   0.000     .0595748    .1587767
             French_colony |   .0520895   .0705182     0.74   0.460    -.0861238    .1903027
           French_speaking |   .0445315   .0511017     0.87   0.384    -.0556259    .1446889
                  legor_fr |   .1133914   .0284836     3.98   0.000     .0575646    .1692181
             IM_being_EIIG |    .786169   .0735441    10.69   0.000     .6420252    .9303129
                     _cons |  -4.358255    .568435    -7.67   0.000    -5.472367   -3.244143
--------------------------------------------------------------------------------------------

. mfx , var(multinational ln_lp_tfprod2   ln_capital_intensity_firm  ln_wage_based_skills_firm    ln_kl ln_hl   contr_
> orig1 contr_prod1 Qc  ln_capital_intensity_cpa_4 ln_skill_intensity_cpa_4  corp_tax_r financ_develop  oecd_1999   ln
> _distw  French_colony French_speaking legor_fr IM_being_EIIG)

Marginal effects after probit
      y  = Pr(intra_firm) (predict)
         =   .1121491
------------------------------------------------------------------------------
variable |      dy/dx    Std. Err.     z    P>|z|  [    95% C.I.   ]      X
---------+--------------------------------------------------------------------
multin~l*|   .1158741      .01685    6.88   0.000   .082856  .148892   .227163
ln_lp_~2 |   .0328243      .01279    2.57   0.010   .007753  .057895   .002856
ln_cap~m |   .0144642      .00638    2.27   0.023   .001968   .02696   3.86705
ln_wag~m |   .0820937      .03184    2.58   0.010   .019681  .144506   3.14631
   ln_kl |  -.0189841      .00534   -3.55   0.000  -.029452 -.008516   11.0822
   ln_hl |   .0553941       .0186    2.98   0.003    .01893  .091859    .90734
contr~g1 |  -.0405019      .00665   -6.09   0.000  -.053538 -.027466   .318803
contr~d1 |  -.0644308       .0137   -4.70   0.000  -.091282  -.03758   .282137
      Qc |   .1264867       .0387    3.27   0.001   .050629  .202345   .811836
ln_cap~4 |    .002775      .00502    0.55   0.581   -.00707   .01262   4.13382
ln_ski~4 |   .0572431      .01705    3.36   0.001   .023821  .090665   3.17455
corp_t~r |  -.1234415      .05945   -2.08   0.038  -.239961 -.006922   .335296
financ~p |  -.0187855      .00935   -2.01   0.045  -.037119 -.000452   .966263
oec~1999*|   .0150593      .00953    1.58   0.114  -.003623  .033742   .826598
ln_distw |   .0208154      .00496    4.20   0.000   .011099  .030531   7.01823
French~y*|   .0102006      .01414    0.72   0.471  -.017515  .037916   .074201
French~g*|   .0086445      .01007    0.86   0.391  -.011096  .028385   .166009
legor_fr*|   .0217408      .00557    3.90   0.000   .010827  .032655   .461018
IM_bei~G |   .1498904      .01438   10.42   0.000   .121703  .178078   .309478
------------------------------------------------------------------------------
(*) dy/dx is for discrete change of dummy variable from 0 to 1

. outreg2 multinational ln_lp_tfprod2   ln_capital_intensity_firm ln_wage_based_skills_firm    ln_kl ln_hl   contr_ori
> g1 contr_prod1 Qc  ln_capital_intensity_cpa_4 ln_skill_intensity_cpa_4  corp_tax_r financ_develop  oecd_1999   ln_di
> stw  French_colony French_speaking legor_fr IM_being_EIIG  using intensive.xls, mfx ctitle(probit) `instruct' replac
> e
intensive.tex
intensive.xls
dir : seeout

. 
. predict linp, xb                                        //linear prediction
(15245 missing values generated)

. gen  IM3 = normalden(linp) / normal(linp)               //inverse Mills' ratio
(15245 missing values generated)

. 
. 
. regress  ln_val  ln_lp_tfprod2   ln_capital_intensity_firm  ln_wage_based_skills_firm    ln_kl ln_hl   contr_orig1 c
> ontr_prod1 Qc  ln_capital_intensity_cpa_4 ln_skill_intensity_cpa_4 corp_tax_r financ_develop  oecd_1999  ln_distw  F
> rench_colony French_speaking legor_fr  IM_being_EIIG IM3   if intra_firm==1, cluster(siren)

Linear regression                                      Number of obs =   11973
                                                       F( 19,  1385) =   29.78
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.1150
                                                       Root MSE      =  2.2456

                                             (Std. Err. adjusted for 1386 clusters in siren)
--------------------------------------------------------------------------------------------
                           |               Robust
                    ln_val |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------------+----------------------------------------------------------------
             ln_lp_tfprod2 |   .1523207   .0910251     1.67   0.094    -.0262413    .3308826
 ln_capital_intensity_firm |   .0979117   .0433671     2.26   0.024     .0128393     .182984
 ln_wage_based_skills_firm |    -.17651   .1427603    -1.24   0.217    -.4565598    .1035397
                     ln_kl |  -.1149042    .084247    -1.36   0.173    -.2801697    .0503613
                     ln_hl |  -.0988036   .2483757    -0.40   0.691    -.5860368    .3884295
               contr_orig1 |  -.1075592   .0939024    -1.15   0.252    -.2917655    .0766471
               contr_prod1 |   .0483866   .1066056     0.45   0.650    -.1607392    .2575124
                        Qc |  -1.817533   .4023972    -4.52   0.000    -2.606907   -1.028159
ln_capital_intensity_cpa_4 |   .2712847   .0610034     4.45   0.000     .1516156    .3909538
  ln_skill_intensity_cpa_4 |     .72817   .1693237     4.30   0.000     .3960114    1.060329
                corp_tax_r |  -2.793624    1.00101    -2.79   0.005    -4.757284   -.8299645
            financ_develop |   .6290469   .1241241     5.07   0.000     .3855554    .8725384
                 oecd_1999 |   .1128918   .1358181     0.83   0.406    -.1535396    .3793231
                  ln_distw |  -.2221206   .0600913    -3.70   0.000    -.3400005   -.1042407
             French_colony |    .564291   .1657806     3.40   0.001     .2390827    .8894993
           French_speaking |  -.0517577   .1617427    -0.32   0.749    -.3690448    .2655294
                  legor_fr |   .0576606   .0861067     0.67   0.503    -.1112531    .2265744
             IM_being_EIIG |  -2.384381   .2118308   -11.26   0.000    -2.799924   -1.968837
                       IM3 |   .1508881    .187611     0.80   0.421    -.2171443    .5189205
                     _cons |   14.18667   1.311874    10.81   0.000      11.6132    16.76015
--------------------------------------------------------------------------------------------

. outreg2          ln_lp_tfprod2   ln_capital_intensity_firm  ln_wage_based_skills_firm    ln_kl ln_hl   contr_orig1 c
> ontr_prod1 Qc  ln_capital_intensity_cpa_4 ln_skill_intensity_cpa_4  corp_tax_r financ_develop  oecd_1999   ln_distw 
>  French_colony French_speaking legor_fr IM_being_EIIG IM3  using intensive.xls, ctitle(intra) `instruct' append
intensive.tex
intensive.xls
dir : seeout

. 
. drop IM3 linp

. gen outs=1-intra_firm

. probit outs  multinational ln_lp_tfprod2   ln_capital_intensity_firm ln_wage_based_skills_firm    ln_kl ln_hl   cont
> r_orig1 contr_prod1 Qc  ln_capital_intensity_cpa_4 ln_skill_intensity_cpa_4  corp_tax_r financ_develop  oecd_1999   
> ln_distw  French_colony French_speaking legor_fr IM_being_EIIG  , cluster(siren)

Iteration 0:   log pseudolikelihood = -34364.214  
Iteration 1:   log pseudolikelihood = -29905.566  
Iteration 2:   log pseudolikelihood = -29765.814  
Iteration 3:   log pseudolikelihood = -29765.455  
Iteration 4:   log pseudolikelihood = -29765.455  

Probit regression                                 Number of obs   =      82923
                                                  Wald chi2(19)   =     547.46
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -29765.455                 Pseudo R2       =     0.1338

                                             (Std. Err. adjusted for 4737 clusters in siren)
--------------------------------------------------------------------------------------------
                           |               Robust
                      outs |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
---------------------------+----------------------------------------------------------------
             multinational |  -.5163951   .0647957    -7.97   0.000    -.6433923   -.3893979
             ln_lp_tfprod2 |  -.1721622   .0662996    -2.60   0.009     -.302107   -.0422173
 ln_capital_intensity_firm |   -.075864   .0329308    -2.30   0.021    -.1404071   -.0113209
 ln_wage_based_skills_firm |  -.4305779    .168588    -2.55   0.011    -.7610042   -.1001516
                     ln_kl |   .0995709   .0275961     3.61   0.000     .0454835    .1536582
                     ln_hl |  -.2905397   .0968288    -3.00   0.003    -.4803207   -.1007587
               contr_orig1 |    .212431   .0337752     6.29   0.000     .1462329    .2786291
               contr_prod1 |    .337937   .0709116     4.77   0.000     .1989528    .4769212
                        Qc |  -.6634176   .1966348    -3.37   0.001    -1.048815   -.2780205
ln_capital_intensity_cpa_4 |  -.0145545   .0264128    -0.55   0.582    -.0663227    .0372137
  ln_skill_intensity_cpa_4 |  -.3002378   .0875127    -3.43   0.001    -.4717595   -.1287162
                corp_tax_r |   .6474457   .3121754     2.07   0.038     .0355931    1.259298
            financ_develop |   .0985292   .0483776     2.04   0.042     .0037108    .1933476
                 oecd_1999 |  -.0816021   .0536217    -1.52   0.128    -.1866987    .0234945
                  ln_distw |  -.1091758   .0253071    -4.31   0.000    -.1587767   -.0595748
             French_colony |  -.0520895   .0705182    -0.74   0.460    -.1903027    .0861238
           French_speaking |  -.0445315   .0511017    -0.87   0.384    -.1446889    .0556259
                  legor_fr |  -.1133914   .0284836    -3.98   0.000    -.1692181   -.0575646
             IM_being_EIIG |   -.786169   .0735441   -10.69   0.000    -.9303129   -.6420252
                     _cons |   4.358255    .568435     7.67   0.000     3.244143    5.472367
--------------------------------------------------------------------------------------------

. 
. predict linp, xb                                        //linear prediction
(15245 missing values generated)

. gen  IM3 = normalden(linp) / normal(linp)               //inverse Mills' ratio
(15245 missing values generated)

. 
. 
. regress  ln_val  ln_lp_tfprod2   ln_capital_intensity_firm  ln_wage_based_skills_firm    ln_kl ln_hl   contr_orig1 c
> ontr_prod1 Qc  ln_capital_intensity_cpa_4 ln_skill_intensity_cpa_4 corp_tax_r financ_develop  oecd_1999  ln_distw  F
> rench_colony French_speaking legor_fr  IM_being_EIIG IM3   if intra_firm==0, cluster(siren)

Linear regression                                      Number of obs =   70739
                                                       F( 19,  4451) =  148.67
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.1596
                                                       Root MSE      =  2.3453

                                             (Std. Err. adjusted for 4452 clusters in siren)
--------------------------------------------------------------------------------------------
                           |               Robust
                    ln_val |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
---------------------------+----------------------------------------------------------------
             ln_lp_tfprod2 |   .5774426   .0745262     7.75   0.000     .4313341     .723551
 ln_capital_intensity_firm |   .3982783   .0306973    12.97   0.000     .3380964    .4584602
 ln_wage_based_skills_firm |  -.0168825   .1069533    -0.16   0.875     -.226564    .1927991
                     ln_kl |  -.1811698   .0386156    -4.69   0.000    -.2568757    -.105464
                     ln_hl |  -.3650583   .1269309    -2.88   0.004    -.6139059   -.1162107
               contr_orig1 |   .7285856   .0495608    14.70   0.000     .6314219    .8257494
               contr_prod1 |   .0369896   .0795667     0.46   0.642    -.1190006    .1929798
                        Qc |  -1.055437   .2371899    -4.45   0.000    -1.520447   -.5904268
ln_capital_intensity_cpa_4 |   .1988713   .0298343     6.67   0.000     .1403812    .2573614
  ln_skill_intensity_cpa_4 |  -.0815691   .0978702    -0.83   0.405    -.2734434    .1103051
                corp_tax_r |  -2.118466   .3993572    -5.30   0.000    -2.901405   -1.335528
            financ_develop |  -.0226487   .0518207    -0.44   0.662     -.124243    .0789456
                 oecd_1999 |   .5020864   .0563033     8.92   0.000      .391704    .6124689
                  ln_distw |   .1891356   .0305388     6.19   0.000     .1292643     .249007
             French_colony |   .2798054   .0683521     4.09   0.000     .1458013    .4138096
           French_speaking |   .4474028    .054986     8.14   0.000     .3396029    .5552027
                  legor_fr |   .0775764   .0408664     1.90   0.058    -.0025422    .1576949
             IM_being_EIIG |   1.705325   .1117038    15.27   0.000      1.48633     1.92432
                       IM3 |   .2210745   .3057922     0.72   0.470    -.3784302    .8205792
                     _cons |   9.703106   .6325816    15.34   0.000     8.462931    10.94328
--------------------------------------------------------------------------------------------

. outreg2          ln_lp_tfprod2   ln_capital_intensity_firm  ln_wage_based_skills_firm    ln_kl ln_hl   contr_orig1 c
> ontr_prod1 Qc  ln_capital_intensity_cpa_4 ln_skill_intensity_cpa_4  corp_tax_r financ_develop  oecd_1999   ln_distw 
>  French_colony French_speaking legor_fr IM_being_EIIG IM3  using intensive.xls, ctitle(outs) `instruct' append
intensive.tex
intensive.xls
dir : seeout

. 
. 
. log close
      name:  <unnamed>
       log:  C:\Users\Public\Documents\Old\Lavoro Gregory\Heckman.log
  log type:  text
 closed on:   3 Sep 2013, 15:00:41
----------------------------------------------------------------------------------------------------------------------
